﻿using System;
using System.Data;

public partial class manager_depteval_View : System.Web.UI.Page
{
    DBHelper db = new DBHelper();
    public int id = 0;
    public int Year = 0;
    public int Month = 0;
    public int zx_psid =0;

    protected void Page_Load(object sender, EventArgs e)
    {
        zx_psid = Convert.ToInt32(Request.QueryString["psid"]);
        id = Convert.ToInt32(Request.QueryString["id"]);
        Year = Convert.ToInt32(Request.QueryString["Year"]);
        Month = Convert.ToInt32(Request.QueryString["Month"]);
        if (!IsPostBack)
        {
            bindData();
        }
    }
    private void bindData()
    {


        string sql1 = "";
        string sql2 = "";
        string sql3 = "";
        string sql4 = "";

        sql1 = "select * from v_A_Eval_Main_Detail where Relid=" + id;

        sql2 = "select * from v_A_Task where state<>0 and zx_psid='" + zx_psid + "' and Year=" + Year + " and Month=" + Month + "  order by id desc ";

        sql3 = "select * from v_A_Task where state<>0 and zx_psid<>'" + zx_psid + "' and (ps_par='" + zx_psid + "' or ps_dept='" + zx_psid + "' ) and Year=" + Year + " and Month=" + Month + "  order by id desc ";

        sql4 = "select * from v_A_Special_Eval where  psid='" + zx_psid + "' and Year=" + Year + " and Month=" + Month + "  order by id desc ";



        DataTable dt = db.getList(sql1);
        rpt_Listask1.DataSource = dt;
        rpt_Listask1.DataBind();

        DataTable dt2 = db.getList(sql2);
        rpt_Listask2.DataSource = dt2;
        rpt_Listask2.DataBind();

        DataTable dt3 = db.getList(sql3);
        rpt_Listask3.DataSource = dt3;
        rpt_Listask3.DataBind();

        DataTable dt4 = db.getList(sql4);
        rpt_Listask4.DataSource = dt4;
        rpt_Listask4.DataBind();
    }
}